﻿<UserControl x:Class="Gao.Poker.App.Desktop.GameTables"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <Grid Margin="0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="6*"/>
            <ColumnDefinition Width="4*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border BorderBrush="White" BorderThickness="0,1" Margin="0,1,0,0" Grid.ColumnSpan="3">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#A1C7CFDA" Offset="0.991"/>
                    <GradientStop Color="#B5F1F1F1"/>
                    <GradientStop Color="#FFD2D2D2" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>

            <StackPanel Margin="0" Orientation="Horizontal" VerticalAlignment="Center">
                <Button Content="新增桌台" Name="btnNew" VerticalContentAlignment="Center" FontSize="16" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
            </StackPanel>
        </Border>
        <DockPanel Margin="0" Grid.Column="0" Grid.Row="1">
            <ListView Name="listView" Margin="0,0,0,0" DockPanel.Dock="Top" ItemsSource="{Binding Path=TablesList}" SelectedItem="{Binding Path=Tables,Mode=TwoWay}"
              VirtualizingStackPanel.VirtualizationMode="Recycling" FontSize="14">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Header="桌号" Width="120" DisplayMemberBinding="{Binding Number}"/>
                        <GridViewColumn Header="座位数" Width="60" DisplayMemberBinding="{Binding Seating}"/>
                        <GridViewColumn Header="桌子状态" Width="70" DisplayMemberBinding="{Binding Available,Converter={StaticResource GenericTypeConverter}, ConverterParameter='Alias=0:空|1:使用'}" />
                        <GridViewColumn Header="备注" Width="280" DisplayMemberBinding="{Binding Remark}" />
                    </GridView>
                </ListView.View>
            </ListView>
        </DockPanel>
        <Grid Margin="5" Grid.Column="1" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="80"/>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="50"/>
            </Grid.RowDefinitions>
            <TextBlock Text="编号：" Margin="1" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" FontSize="14" />
            <TextBox Text="{Binding Path=Tables.Number}" Margin="1" Grid.Column="1" VerticalContentAlignment="Center" Grid.Row="0" FontSize="14"/>

            <TextBlock Text="座位数："  Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" FontSize="14"/>
            <TextBox Text="{Binding Path=Tables.Seating}" Margin="1" VerticalContentAlignment="Center"  Grid.Column="1" Grid.Row="1" FontSize="14"/>

            <TextBlock Text="备注：" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="2" FontSize="14"/>
            <TextBox Text="{Binding Tables.Remark, Mode=TwoWay}" Margin="1" VerticalAlignment="Top" Grid.Column="1" Grid.Row="2" Height="120" FontSize="14"/>

            <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2"  Grid.Row="3" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Center">
                <Button Padding="5" Style="{DynamicResource Orrange}" Width="60" FontSize="16" Height="35" Name="btnLogin" 
                    Command="{Binding SaveCommand}" CommandParameter="{Binding Tables}">保存</Button>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
